<?php

    use yii\helpers\Html;
    use yii\bootstrap\ActiveForm;

?>
<script>
//     $(function(){
//    var aaaa=$('.table').find('.sdsd').eq(0).text();    
// $('.sdsd').click(function(){
//     var sss=$(this).find('a').text();
// });

//     });
$(document).ready(function(){
    var lastName = null;
    $("td input").click(function(){
        $("td input").removeAttr('readonly');
        lastName = $("td input").val();
    });

    $("td input").blur(function(){
        var uid = "<?php echo $uid ?>";
        newName = $("td input").val();
        if (newName != lastName) {
            $.get('change-testing-name?newName='+ newName + '&uid=' + uid, function(data) {
                alert(data);
                /*optional stuff to do after success */
            });
        }
    });
});
</script>

<div class="table-responsive">
    <table class="table table-hover">
        <tr><th>测评报告</th> <th>时间</th> <th>操作</th></tr>
        <?php 
        foreach ($testingResultArray as $testingResult) {
            $url = "view-testing?testingId=" . $testingId;
            $deleteUrl = "delete-testing?uid=" . uid . "&testingId=" .$testingId;
        ?>
        <tr>
            <td ><input class="name" readonly="" value=<?php echo $testingResult->name ?>></td>
            <td class="time"><?php echo $testingResult->time ?> </td>
            <td>
                <a class="display" href=<?php echo $url ?>>查看-</a>
                <a href=<?php echo $forwardUrl ?>>转发-</a>
                <a href=<?php echo $link ?>>链接-</a>
                <a href=<?php echo $deleteUrl ?>>删除</a></td>
        </tr>
        <?php 
        }
        ?>

    </table>
</div>